public class Main {
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n=scan.nextInt();
      int[] a=new int[n];
      int[] count=new int[100001];
      for(int i=0;i<n;i++){
        a[i]=scan.nextInt();
        count[a[i]]++;
      }
      int count1=0;
      int count2=0;
      for(int i=0;i<count.length;i++){
        if(count[i]==1)
          count1++;
        if(count[i]>2)
          count2+=count[i]-2;
      }
      System.out.println(count1<count2?count2:(count1+count2)/2);
    }
}